#ifndef _HCC_ERROR_CODE_BPX_UPGRADE_H_
#define _HCC_ERROR_CODE_BPX_UPGRADE_H_

#include "ofc/ofc_types.h"
#include "hcc/hcc_error_code.h"
#include "hcc/hcc_error_code_mid.h"

#ifdef __cplusplus
extern "C" {
#endif

// 不含行号的错误码生成
#define HCC_MAKE_BPX_UPGRADE_ERROR(error_code) (int)HCC_MAKE_MID_WARE_ERROR(kHccMidWareBpxUpgrade, error_code, HCC_ERROR_LEVEL_ERROR)
// 含行号的错误码生成
#define HCC_MAKE_BPX_UPGRADE_ERROR_LINE(error_code) (int)HCC_ERROR(HCC_MAKE_MID_WARE_ERROR(kHccMidWareBpxUpgrade, error_code, HCC_ERROR_LEVEL_ERROR))


/**
 * bpx升级组件:
 */
enum THccMidBpxUpragdeErrorCodeTag
{
	kHccMidBpxUpgradeSuccess	=	HCC_ERROR_SUCCESS,			///< 成功,没有错误
	kHccMidBpxUpgradeStateEarseFail	=	HCC_MAKE_BPX_UPGRADE_ERROR(1),			///<OTA分区擦除失败
	kHccMidBpxUpgradeStateFileNotExist	=	HCC_MAKE_BPX_UPGRADE_ERROR(2),			///<升级文件不存在
	kHccMidBpxUpgradeStateFileReadFail	=	HCC_MAKE_BPX_UPGRADE_ERROR(3),			///<文件读取失败
	kHccMidBpxUpgradeStateWriteFail	=	HCC_MAKE_BPX_UPGRADE_ERROR(4),			///<文件写入失败
	kHccMidBpxUpgradeStateVerifyFail	=	HCC_MAKE_BPX_UPGRADE_ERROR(5),			///<文件校验失败
	kHccMidBpxUpgradeStateBpiReject	=	HCC_MAKE_BPX_UPGRADE_ERROR(6),			///<bpi拒绝升级,详见底层错误码
	kHccMidBpxUpgradeStateBpiError	=	HCC_MAKE_BPX_UPGRADE_ERROR(7),			///<bpi错误，详见底层错误码
	kHccMidBpxUpgradeStateFailReasonConfirming	=	HCC_MAKE_BPX_UPGRADE_ERROR(8),			///<请求升级失败，正在升级确认
	kHccMidBpxUpgradeStateFailReasonWriting	=	HCC_MAKE_BPX_UPGRADE_ERROR(9),			///<请求升级失败，正在写入文件
	kHccMidBpxUpgradeStateFailReasonChecking	=	HCC_MAKE_BPX_UPGRADE_ERROR(10),			///<请求升级失败，正在检查升级条件
	kHccMidBpxUpgradeStateNoRequest	=	HCC_MAKE_BPX_UPGRADE_ERROR(11),			///<取消失败，当前无升级请求
	kHccMidBpxUpgradeStateAreadlySetFlag	=	HCC_MAKE_BPX_UPGRADE_ERROR(12),			///<取消失败，已置升级标记
	kHccMidBpxUpgradeStateRetry	=	HCC_MAKE_BPX_UPGRADE_ERROR(13),			///<取消失败，忙
	kHccMidBpxUpgradeStateError	=	HCC_MAKE_BPX_UPGRADE_ERROR(14),			///<取消失败，状态错误
	kHccMidBpxUpgradeConfrimFail	=	HCC_MAKE_BPX_UPGRADE_ERROR(15),			///<确认升级失败
};
typedef enum THccMidBpxUpragdeErrorCodeTag THccMidBpxUpragdeErrorCode;


typedef Int32 THccMidBpxUpragdeErrorCodeLine;
#define kHccMidBpxUpgradeSuccessLine	HCC_ERROR_SUCCESS	///< 成功,没有错误
#define kHccMidBpxUpgradeStateEarseFailLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(1)	///<OTA分区擦除失败
#define kHccMidBpxUpgradeStateFileNotExistLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(2)	///<升级文件不存在
#define kHccMidBpxUpgradeStateFileReadFailLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(3)	///<文件读取失败
#define kHccMidBpxUpgradeStateWriteFailLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(4)	///<文件写入失败
#define kHccMidBpxUpgradeStateVerifyFailLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(5)	///<文件校验失败
#define kHccMidBpxUpgradeStateBpiRejectLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(6)	///<bpi拒绝升级,详见底层错误码
#define kHccMidBpxUpgradeStateBpiErrorLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(7)	///<bpi错误，详见底层错误码
#define kHccMidBpxUpgradeStateFailReasonConfirmingLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(8)	///<请求升级失败，正在升级确认
#define kHccMidBpxUpgradeStateFailReasonWritingLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(9)	///<请求升级失败，正在写入文件
#define kHccMidBpxUpgradeStateFailReasonCheckingLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(10)	///<请求升级失败，正在检查升级条件
#define kHccMidBpxUpgradeStateNoRequestLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(11)	///<取消失败，当前无升级请求
#define kHccMidBpxUpgradeStateAreadlySetFlagLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(12)	///<取消失败，已置升级标记
#define kHccMidBpxUpgradeStateRetryLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(13)	///<取消失败，忙
#define kHccMidBpxUpgradeStateErrorLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(14)	///<取消失败，状态错误
#define kHccMidBpxUpgradeConfrimFailLine	HCC_MAKE_BPX_UPGRADE_ERROR_LINE(15)	///<确认升级失败

//旧版本适配补丁
#define kHccMidBpxUpragdeCodeSuccess kHccMidBpxUpgradeSuccess


#ifdef __cplusplus
}  // extern "C"
#endif

#endif // _HCC_ERROR_CODE_BPX_UPGRADE_H_
/**
 * @
 */
